In electronic devices, a timer circuit that measures a predetermined time is often used to control the operation timing of each function. Such a timer circuit is also used, for example, for power supply monitoring and abnormality detection of the electronic devices, but if a deviation occurs in measurement time, it may be a factor of erroneous detection such as abnormality. Therefore, it is necessary to measure the time with high accuracy in such a timer circuit.
Generally, the timer circuit measures a predetermined time by counting, by a counter circuit, the number of clocks (pulses) of a reference clock signal generated by an oscillator. In the oscillator, a CR oscillation circuit that oscillates according to a time constant of capacitors and resistors is used to generate the reference clock signal. However, an oscillation frequency may vary according to temperature characteristics or manufacturing variations of semiconductor elements or the like included in the oscillation circuit. When the oscillation frequency (i.e., the reference clock signal) of the oscillator varies, the time measured by the timer circuit varies as a result.
A related art discloses a clock signal generation circuit including an oscillator circuit (a first oscillation circuit) using an oscillator and a CR oscillation circuit (a second oscillation circuit) where a configuration in which an oscillation frequency of the second oscillation circuit is adjusted by switching values of capacitors and/or resistors of the second oscillation circuit by a trimming circuit based on an oscillation frequency of the first oscillation circuit temperature-compensated by using a detection value of a temperature sensor. In the configuration of the related art, the adjustment of a resonance frequency of the second oscillation circuit is performed, for example, when a power supply voltage varies more than a predetermined value. Thus, with the configuration of the related art, it is possible to realize a highly accurate oscillation frequency even when the temperature and the power supply voltage vary.
Further, another related art discloses a trimming device for correcting a deviation in electrical characteristics of semiconductor devices. In the trimming device of the related art, a bit value for a device to be trimmed is set by cutting a fuse depending on an amount of deviation of the electric characteristics to be corrected, and the electrical characteristics are corrected in the device to be trimmed depending on the bit value.
Conventionally, a technique for adjusting an oscillation frequency of an oscillator using a trimming circuit for cutting a conductive part such as a fuse is known. As described above, in the oscillator, the oscillation frequency may deviate from a desired value due to temperature and manufacturing variations.
In the oscillator having the trimming circuit described above, the oscillation frequency may be adjusted by adjusting the values of capacitors or resistors in the oscillator. When adjusting all the influences of temperature characteristics and manufacturing variations with the oscillator, it is necessary to prepare a large number of capacitors and resistors to be used for adjustment according to a desired adjustment range.
In addition, in a case where such a circuit is formed by an integrated circuit (IC), since the capacitors and the resistors for adjustment are larger in size than other logic circuits, when a large number of capacitors and resistors for adjustment are prepared, the chip area of the IC becomes large, which is a factor hindering miniaturization.